/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sclbtblibper")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sclbtblibper.findAll", query = "SELECT s FROM Sclbtblibper s"),
    @NamedQuery(name = "Sclbtblibper.findBySclbtblibperid", query = "SELECT s FROM Sclbtblibper s WHERE s.sclbtblibperid = :sclbtblibperid"),
    @NamedQuery(name = "Sclbtblibper.findByConstadocente", query = "SELECT s FROM Sclbtblibper s WHERE s.constadocente = :constadocente")})
public class Sclbtblibper implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sclbtblibperid")
    private Integer sclbtblibperid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "constadocente")
    private boolean constadocente;
    @JoinColumn(name = "scthtbdatosgenid", referencedColumnName = "scthtbdatosgenid")
    @ManyToOne(optional = false)
    private Scthtbdatosgen scthtbdatosgenid;
    @JoinColumn(name = "sclbtblibrosid", referencedColumnName = "sclbtblibrosid")
    @ManyToOne(optional = false)
    private Sclbtblibros sclbtblibrosid;

    public Sclbtblibper() {
    }

    public Sclbtblibper(Integer sclbtblibperid) {
        this.sclbtblibperid = sclbtblibperid;
    }

    public Sclbtblibper(Integer sclbtblibperid, boolean constadocente) {
        this.sclbtblibperid = sclbtblibperid;
        this.constadocente = constadocente;
    }

    public Integer getSclbtblibperid() {
        return sclbtblibperid;
    }

    public void setSclbtblibperid(Integer sclbtblibperid) {
        this.sclbtblibperid = sclbtblibperid;
    }

    public boolean getConstadocente() {
        return constadocente;
    }

    public void setConstadocente(boolean constadocente) {
        this.constadocente = constadocente;
    }

    public Scthtbdatosgen getScthtbdatosgenid() {
        return scthtbdatosgenid;
    }

    public void setScthtbdatosgenid(Scthtbdatosgen scthtbdatosgenid) {
        this.scthtbdatosgenid = scthtbdatosgenid;
    }

    public Sclbtblibros getSclbtblibrosid() {
        return sclbtblibrosid;
    }

    public void setSclbtblibrosid(Sclbtblibros sclbtblibrosid) {
        this.sclbtblibrosid = sclbtblibrosid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sclbtblibperid != null ? sclbtblibperid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sclbtblibper)) {
            return false;
        }
        Sclbtblibper other = (Sclbtblibper) object;
        if ((this.sclbtblibperid == null && other.sclbtblibperid != null) || (this.sclbtblibperid != null && !this.sclbtblibperid.equals(other.sclbtblibperid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sclbtblibper[ sclbtblibperid=" + sclbtblibperid + " ]";
    }
    
}
